#ifndef __RECVCOMM__
#define __RECVCOMM__

#include "pathStack.h"


typedef enum{
    DATA,
    CD,
    LS,
    PUTS,
    GETS,
    REMOVE,
    PWD,
    MKDIR
}TYPE;

typedef struct commTrain_s{
    TYPE type;
    int length;
    char data[1000];
}commTrain_t;

int recv_comm(int netfd, char *commPath, TYPE *curComm);
int do_comm(int netfd, commandStack_t *curPath);
int do_ls(int netfd,commandStack_t *stack,char * pathname);
int do_pwd(int netfd,commandStack_t *stack,char *pathname);
int do_cd(int netfd,commandStack_t *stack,char *pathname);
int do_rmdir(int netfd,commandStack_t *stack,char *pathname);
int do_mkdir(int netfd,commandStack_t *commandStack,char *pathname);
int s_download(int netfd,commandStack_t *pcommandStack);
int s_recv_up(int netfd,commandStack_t *pcommandStack);
int get_curpath(commandStack_t *stack,char *path);
int trans_res(int netfd,const char res[]);
#endif


